Queue management (QM) is a common function of a communications processing chip, and is mainly used for managing a data packet by using a buffer address. Because the communications processing chip needs to process a relatively large quantity of services, during queue management, a queue is generally established in a shared buffer according to a service type. When a data packet arrives, a buffer address is allocated to the arrived data packet in a memory, and then a packet descriptor (PCD) including the buffer address is written into the queue according to a type for management. Because data packets of different types arrive in a staggered manner, it cannot be ensured that buffer addresses of data packets of a same type in the memory are contiguous, and it cannot be ensured that buffer addresses of packet descriptors of the data packets in the buffer are contiguous, either. Therefore, a queue linked sublist needs to be generated for each queue, and packet descriptors of data packets that belong to a same queue are linked in the queue linked sublist. Specifically, in addition to the queue and the queue linked sublist, a queue head list and a queue tail list are established. A pointer of the queue head list points to a buffer address of the first packet descriptor in the queue, and a pointer of the queue tail list points to a buffer address of the last packet descriptor in the queue. Furthermore, buffer addresses of packet descriptors in the queue are linked in the queue linked sublist. To enqueue a data packet, if a queue is not empty, a packet descriptor is written into the queue and a buffer address of the packet descriptor is written into a queue linked sublist. To dequeue a data packet, a pointer of a queue head list is read, a packet descriptor is read from a queue according to a buffer address to which the pointer of the queue head list points, then a data packet is read from a memory according to a buffer address in the packet descriptor and is sent to a corresponding Media Access Control (MAC) port for transmission, and a buffer address of a next packet descriptor is read from a queue linked sublist, so as to update the pointer of the queue head list.
Because some data packets are relatively large but a bandwidth of a MAC port is limited, to avoid a data burst caused by difficulty in transmitting a relatively large data packet because of an extremely low bandwidth of a MAC port, in existing queue management, a data packet is first divided into several slices, and then one buffer address is allocated to each slice in a memory. During enqueuing, slice information of a slice is enqueued for management instead of a packet descriptor. During dequeuing, a pointer of a queue head list is read, slice information is read from a queue according to a buffer address to which the pointer of the queue head list points, then a slice is read from a memory according to a buffer address in the slice information and is sent to a corresponding MAC port for transmission, and a buffer address of a next piece of slice information is read from a queue linked sublist, so as to update the pointer of the queue head list. However, because of a macro restriction of a MAC port on a communications processing chip, it is required that the communications processing chip sends a slice to the MAC port according to priorities of queues, and the MAC port transmits the slice according to the priorities. When dequeuing is performed in a unit of a data packet, a priority scheduling policy is that priority determining and priority switching may be performed after dequeuing of each data packet is completed. However, when dequeuing is performed in a unit of a slice, if the priority scheduling policy for performing dequeuing in a unit of a data packet is used, priority determining and priority switching are performed after dequeuing of each slice is completed, which is inconsistent with entire-packet dequeuing; or when entire-packet dequeuing is performed, an existing priority scheduling policy cannot be implemented. Consequently, when dequeuing is performed in a unit of a slice, it is difficult to perform priority processing within a same MAC port based on the existing priority scheduling policy.